<script setup>
import { onMounted } from "vue";
import socket from "@/utils/socket";
import { ElMessage } from "element-plus";
import "element-plus/dist/index.css";

onMounted(() => {
  // 检查是否有有效的登录信息
  const imKey = localStorage.getItem("serviceImKey");
  if (imKey) {
    const SOCKET_URL = import.meta.env.VITE_SOCKET_URL;
    socket.connect(SOCKET_URL, imKey);
  }
});
</script>

<template>
  <router-view />
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
</style>
